<ui:composition xmlns:p='http://primefaces.org/ui'
                xmlns:ui='http://java.sun.com/jsf/facelets'>

<p:focus context=':#{formId}:#{focus}'/>

<script language='javascript'>

function nx(event,focusId) { return nxt(event,'#{formId}:'+focusId); }

function fc(focusId) {document.getElementById('#{formId}:'+focusId).focus() }

</script>

</ui:composition>